<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
    <head>
        <th:block th:include="include::header('整改录入')" />
    </head>
    <style type="text/css">
        #febs-accidentReportRectify .febs-edit-area {
            font-size: 15px;
        }
    </style>
    <body class="febs-container" id="febs-accidentReportRectify">
        <div class="febs-body layui-fluid" lay-title="整改录入">
            <div class="febs-body-search">
                <form class="layui-form layui-table-form" lay-filter="accidentReportRectify-table-form" id="accidentReportRectify-table-form">
                    <div class="layui-card">
                        <div class="layui-card-body">
                            <div class="layui-form-item">
                                <div class="layui-inline" id="post-tenant" th:if="${hasHeadCompanyRole }">
                                    <label class="layui-form-label layui-form-label-sm">公司名称</label>
                                    <div class="layui-input-inline" style="width:240px;">
                                        <select name="tenantSelect" id="tenantSelect" lay-search="" >
                                            <option th:each="item:${tenantList }"
                                                    th:value="${item.tenantId}" th:text="${item.tenantName}"
                                                    th:selected="${currentTenantId ==item.tenantId}">
                                        </select>
                                    </div>
                                </div>
                                <div class="layui-inline">
                                    <label class="layui-form-label layui-form-label-sm">事故编号</label>
                                    <div class="layui-input-inline" >
                                        <input type="text" name="accidentNo" autocomplete="off" class="layui-input">
                                    </div>
                                </div>
                                <div class="layui-inline">
                                    <label class="layui-form-label layui-form-label-sm">事故名称</label>
                                    <div class="layui-input-inline" >
                                        <input type="text" name="accidentTitle" autocomplete="off" class="layui-input">
                                    </div>
                                </div>
                                <div class="layui-inline">
                                    <label class="layui-form-label">发生时间</label>
                                    <div class="layui-input-inline" id="laydate-range">
                                        <input type="text" name="startDate" autocomplete="off" id="start-date" lay-verify="date"
                                               class="layui-input" placeholder="开始日期">
                                    </div>
                                    <div class="layui-form-mid">-</div>
                                    <div class="layui-input-inline">
                                        <input type="text" name="endDate" autocomplete="off" id="end-date" lay-verify="date"
                                               class="layui-input" placeholder="结束日期">
                                    </div>
                                </div>
                                <div class="layui-inline">
                                    <label class="layui-form-label layui-form-label-sm">事故类型</label>
                                    <div class="layui-input-inline" style="width: 240px;">
                                        <select name="accidentType" id="accidentType" lay-search="" >
                                        </select>
                                    </div>
                                </div>
                                <div class="layui-inline">
                                    <label class="layui-form-label layui-form-label-sm">事故等级</label>
                                    <div class="layui-input-inline" >
                                        <select name="accidentLevel" id="accidentLevel" lay-search="" >
                                        </select>
                                    </div>
                                </div>
<!--                                <div class="layui-inline">-->
<!--                                    <label class="layui-form-label">整改部门</label>-->
<!--                                    <div class="layui-input-inline" style="width: 240px;">-->
<!--                                        <select name="rectificationDeptId" lay-filter="rectificationDeptSelect" id="rectificationDeptSelect">-->
<!--                                            <option value="">请选择</option>-->
<!--                                            <option th:each="dept:${deptList}" th:value="${dept.deptId}"-->
<!--                                                    th:text="${dept.deptName}"></option>-->
<!--                                        </select>-->
<!--                                    </div>-->
<!--                                </div>-->
                                <div class="layui-inline">
                                    <label class="layui-form-label">整改人</label>
                                    <div class="layui-input-inline">
                                        <input type="text" name="rectificationUsers" autocomplete="off" class="layui-input">
<!--                                        <select name="rectificationUserId" lay-filter="rectificationUserSelect" id="rectificationUserSelect">-->
<!--                                        </select>-->
                                    </div>
                                </div>
                                <div class="layui-inline">
                                    <label class="layui-form-label layui-form-label-sm">整改状态</label>
                                    <div class="layui-input-inline" >
                                        <select name="rectificationStatus" id="rectificationStatus" lay-search="" >
                                            <option value="">请选择</option>
                                            <option value="2">待整改</option>
                                            <option value="3">审核退回</option>
                                            <option value="4">待审核</option>
                                            <option value="5">完成</option>
                                        </select>
                                    </div>
                                </div>

                            <div class="layui-inline">
                                <div id="query" class="layui-btn">
                                    <em class="layui-icon">&#xe615;</em> 查询
                                </div>
                            </div>

                        </div>
                    </div>
                </div>
            </form>
        </div>

            <div class="febs-table-full">
                <table lay-filter="accidentReportRectifyTable" lay-data="{id: 'accidentReportRectifyTable'}"></table>
            </div>

        </div>
        <th:block th:include="include::foot" />
        <script type="text/html" id="accidentReport-option">
            <span shiro:lacksPermission="accidentReport:rectifyRecord">
            <span class="layui-badge-dot febs-bg-orange"></span> 无权限
            </span>
<!--            accident_report_reason  rectification_status(整改状态): 1:待整改指派 2：已指派待整改 3：已退回待整改  4：已整改待审核 5：已完成-->
            {{# if(d.rectificationStatus=='2'){  }}
                <button type="button" lay-event="rectify-record" class="layui-btn layui-btn-xs  layui-btn-primary layui-border-green" shiro:hasPermission="accidentReport:rectifyRecord">
                    <em class="layui-icon layui-icon-edit"></em>整改录入
                </button>
            {{# } else {  }}
                - -
            {{# } }}

        </script>
        <script data-th-inline="javascript" >
            tenantId = [[${tenantId}]],
            hasHeadCompanyRole = [[${hasHeadCompanyRole}]];
            reasonTypeList = [[${reasonTypeList}]];
            accidentTypeList = [[${accidentTypeList}]];
            accidentLevelList = [[${accidentLevelList}]];
        </script>
        <script th:src="@{/febs/js/accidentReport/accidentReportRectifyList.js(v=1)}"></script>
    </body>
</html>